<template>
	<div class="deposition-table-warpper">
		<el-table :data="testimoneyTableData" style="width: 100%" border empty-text="你还未添加抄录证言">
			<el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
			<el-table-column prop="message" label="抄录证言" width="auto" align="center"> </el-table-column>
			<el-table-column label="操作" width="180" align="center">
				<template slot-scope="scope">
					<div class="btn-box">
						<el-button type="primary" @click="modifyDeposition(scope.row)">修改</el-button>
						<el-button type="danger" @click="delDeposition(scope.row)">删除</el-button>
					</div>
				</template>
			</el-table-column>
		</el-table>
	</div>
</template>

<script>
export default {
	props: {
		testimoneyTableData: {
			type: Array,
			default: () => []
		}
	},
	data() {
		return {};
	},
	methods: {
		modifyDeposition(data) {
			this.$emit('modifyDeposition', data);
		},
		delDeposition(data) {
			this.$confirm(`确定要删除 "${data.message}" 抄录证言吗?`, '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			})
				.then(() => {
					this.$emit('delDeposition', data);
				})
				.catch(e => {
					console.log(e);
				});
		}
	}
};
</script>

<style lang="less" scoped>
.deposition-table-warpper {
}
</style>
